1. Field of the Invention
The present invention relates to an encoding/decoding device and method thereof, and more particularly, to an image encoding/decoding device and method thereof.
2. Description of the Prior Art
Currently, capability of display devices has advanced from simply processing two-dimensional pixels in a current picture to processing pixels at the same location respectively in a previous picture and the current picture, thereby upgrading picture quality. It has thus become an essential hardware expense to utilize a memory for storing pixels in the previous picture. Also, it is thus an important and desirable solution to reduce the amount of pixel data by some compression technology. Moreover, the previous picture requires lossless compression because pixel values of the previous picture should be perfectly recoverable after compression. One common lossless compression method is the variable length coding (VLC) encoding method. With the VLC encoding method, the address of the current data cannot be available unless the previous data has been decoded. Therefore, in a case that three channels (e.g. RGB or YCbCr channels) of data are required to be stored in a display device at a time, the three channels may need to be encoded/decoded separately if the corresponding VLC encoder/decoder cannot perform all encoding/decoding processes for the three channels in a unit time interval for displaying one pixel. Also, in such a case, how to achieve the best compression effect by utilizing the same memory for storing compressed data of the three channels is an important issue. When the desired compression effect cannot be achieved utilizing a memory with a fixed volume, important data may need to be stored into the memory in a partly recoverable manner. The so-called best compression effect hereinabove thus corresponds to the percentage of success in compressing different pictures.
In the prior art, a typical way to share a memory is to divide the memory space into three separate memory areas. A channel in low compression cannot take advantage of the remaining available space of a memory area for a channel in high compression in such way, however. Moreover, the corresponding memory controller should operate in a three-read-three-write manner instead of a one-read-one-write manner, thereby increasing complexity and decreasing efficiency of the memory controller. Another conventional way to share a memory is to divide the memory space into a plurality of memory units having the same fixed volume and label each memory unit with a code corresponding to one of the three channels. In such way, the labels have to occupy some memory space, thereby reducing the memory space available for the compressed picture. In an application where the memory is an important resource, this drawback is too obvious to be ignored.